package com.yazi.mxz.client;

import com.yazi.mxz.client.Client;
import com.yazi.mxz.client.ClientFactory;
import com.yazi.mxz.client.Config;
import com.yazi.mxz.client.DefaultConfig;


/**
 * 
 * @author mo_yq5
 * @date 2014-5-13
 */
public class ClientFactory {
	private static Client client;
	private static Config config = new DefaultConfig();
	public static Client getCurrentClient() {
		if (null == client) {
			return newClient();
		}
		return client;
	}
	public static Client newClient() {
		return new Client(config);
	}
	public static Config getConfig() {
		return config;
	}
	public static void setConfig(Config config) {
		ClientFactory.config = config;
	}
}
